﻿using System;
using System.Collections.Generic;
using System.Text;
using GD.ModelContest.DataAccess;
using GD.ModelContest.Model;

namespace GD.ModelContest.Service.Impl
{
    public class NewsServiceImpl : INewsService
    {
        private INewsDao infoDao;

        public NewsServiceImpl(INewsDao infoDao)
        {
            this.infoDao = infoDao;
        }

        #region INewsService 成员

        public bool InsertNews(mc_news news)
        {
            return infoDao.InsertNews(news);
        }

        public bool UpdateNews(mc_news news)
        {
            return infoDao.UpdateNews(news);
        }

        public bool DeleteNews(int newsId)
        {
            return infoDao.DeleteNews(newsId);
        }

        public mc_news GetNewsById(int newsId)
        {
            return infoDao.GetNewsById(newsId);
        }

        public IList<mc_news> GetNewsCollection(int newsTypeId, int pageIndex, int pageSize, ref int count)
        {
            return infoDao.GetNewsCollection(newsTypeId, pageIndex, pageSize, ref count);
        }

        public IList<mc_news> GetNewsCollection(int newsTypeId, int num)
        {
            return infoDao.GetNewsCollection(newsTypeId, num);
        }

        #endregion
    }
}
